<?php $sessao = new Zend_Session_Namespace('Parametros'); ?>
<?php 

?>
<html lang="pt-br">
<head>
    <meta http-equiv="Content-Type" content="text/html;charset=utf-8">
</head>
<body>
    <div class="pagina">
    <?php
    $count = 0;
    $total = count($this->texto) - 1;
    foreach($this->texto as $key => $row) {
        
        $img = '';
        $imgs = 'public/upload/aluno/'.$row['ALU_ID'].'_crt.*';
        foreach (glob($imgs) as $src) {
            $img = $src;
        }
        if(strlen($img) > 6){ 
            $count++;
    ?>
        <div class="carteirinha">
            
            <div class="frente">
                <div class="titulo">CARTEIRA DE IDENTIFICAÇÃO ALUNO GARRA</div>
                <table class="dados_alunos">
                    <tr>
                        <td>
                            <label>ALUNO</label>
                            <span><?php echo $row['ALU_NOM']; ?></span>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <label>CPF</label>
                            <span><?php echo $row['ALU_CPF']; ?></span>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <label>MATRÍCULA</label>
                            <span><?php echo $row['MAT_ID']; ?></span>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <label>CURSO</label>
                            <span><?php echo $row['CBS_NOM'].'&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;'.$row['NRT_NOM'].'&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;'.$row['CUR_ANO']; ?></span>
                        </td>
                    </tr>
                </table>
                
                
                <div class="foto_aluno">
                    <?php if(strlen($img) > 5){ ?>
                        <img class="logo" src="<?php echo '/'.$img; ?>" />
                    <?php } ?>
                </div>
                
                <div class="cnt_logo_cart">
                    Pré-Vestibular
                    <img class="logo_cart" src="/public/media/images/logo_cart.png" />
                    <?php echo $sessao->parametros['PAR_NOM']; ?>
                </div>
                
                <div class="site"><span>sistemagarra</span>.com.br</div>
            </div>
            
            <div class="verso">
                <table>
                    <tr>
                        <td>
                            <span></span>
                            <label>DEZEMBRO</label>
                        </td>
                        <td>
                            <span></span>
                            <label>JUNHO</label>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <span></span>
                            <label>NOVEMBRO</label>
                        </td>
                        <td>
                            <span></span>
                            <label>MAIO</label>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <span></span>
                            <label>OUTUBRO</label>
                        </td>
                        <td>
                            <span></span>
                            <label>ABRIL</label>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <span></span>
                            <label>SETEMBRO</label>
                        </td>
                        <td>
                            <span></span>
                            <label>MARCO</label>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <span></span>
                            <label>AGOSTO</label>
                        </td>
                        <td>
                            <span></span>
                            <label>FEVEREIRO</label>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <span></span>
                            <label>JULHO</label>
                        </td>
                        <td>
                            <span></span>
                            <label>JANEIRO</label>
                        </td>
                    </tr>
                </table>
            </div>
            
        </div>
        
        <?php 
        
            if($count == 3 && $total > $key){
                $count = 0;
                echo '<div class="espaco"></div>';
            }
        }

    } ?>
        
    </div>

<?php
/* 
folha a4
width: 2480px;
    height: 3508px;
 */
?>

<style>

@font-face{ 
    font-family: 'MyriadProBold';
    src: url('<?php echo $this->urlbase?>/public/media/fonts/MyriadPro-BoldCond.otf'); 
}

@font-face{ 
    font-family: 'MyriadPro';
    src: url('<?php echo $this->urlbase?>/public/media/fonts/MyriadPro-Regular.otf'); 
}

@font-face{ 
    font-family: 'MyriadProLight';
    src: url('<?php echo $this->urlbase?>/public/media/fonts/MyriadPro-Light.otf'); 
}

@font-face{ 
    font-family: 'Century Gothic';
    src: url('<?php echo $this->urlbase?>/public/media/fonts/Century Gothic.ttf'); 
}

.pagina{
    height: 600px;
    width: 1000px;
    text-align: center;
    margin-bottom: 50px;
    color:#FFF;
}  

.carteirinha{
    float: left;
    background-color: #A43030;
    width: 300px;
    padding: 10px 10px 5px;
    margin-right: 10px;
    margin-bottom: 10px;
}

.espaco{
    display: block;
    height: 296.7px;
    clear: both;
}
.espaco2{
    display: block;
    height: 1px;
    clear: both;
}

.frente{
    font-family: 'MyriadProBold'; 
    font-size: 6px;
    overflow: hidden;
    height: 5cm;//196.5px;
}

.verso{
    font-family: 'MyriadPro';
    font-size: 4px;
    overflow: hidden;
    height: 4.8cm; // 5cm
    padding-top: 0.20cm; // 
}

.titulo{
    font-family: 'Century Gothic'; 
    font-size: 10px;//7.5px;
    text-align: center;
    margin-bottom: 5px;
}
.dados_alunos{
    font-size: 10px;//6px;
    float: left;
}
.dados_alunos label{
    font-weight: bold;
    color:#FFF;
    margin-left: 5px;
}
.dados_alunos span{
    font-size: 12px;
    width: 197px;
    padding-top: 2px;
    padding-bottom: 1px;
    padding-left: 5px;
    height: 16px;
    border-radius: 5px;
    display: block;
    background-color: #FFF;
    color:#000 !important;
    text-transform: uppercase;
    margin-bottom: -2px;
    margin-top: -2px;
}
.site{
    float: left;
    width: 150px;
    text-align: left;
    margin-top: 20px;
    font-size: 10px;
    font-family: 'MyriadProLight';
}
.site span{
    font-weight: bold;
    font-family: 'MyriadProBold'; 
}
.foto_aluno{
    float: right;
    width: 75px;
    height: 95px;
    border-radius: 5px;
    background-color: #FFF;     
    margin-top: 12px;
    overflow: hidden;
    margin-right: 5px; 
}
.cnt_logo_cart{
    float: right;
    width: 69px;
    text-align: center;
    margin-top: 12px;
    margin-right: 6px;
    font-size: 9px;
}
.logo_cart{
    width: 69px;
}
.verso label{
    color:#FFF;
    font-family: 'MyriadPro';
    font-size: 5.5px;  
    float: right;
    margin-top: -6px;
    margin-right: 5px;
    /* Safari */
    -webkit-transform: rotate(-180deg);
    /* Opera */
    -o-transform: rotate(-180deg);
    /* Firefox */
    -moz-transform: rotate(-180deg);
}
.verso span{
    width: 145px; 
    height: 20px;
    border-radius: 5px;
    border-radius: 5px;
    display: block;
    background-color: #FFF;
    color:#000 !important;
    margin-bottom: 5px;
}
.verso td{
    //padding-right: 24px;
}
</style>
<script>  
window.print(); 
</script>

<body>
</html>
